home *** CD-ROM | disk | FTP | other *** search
- on initGlobals
- global gKnobState -- a number between 0 and 4 indicating PDA mode.
- global gKnobLow -- the castNumber representing the lowest knob inbetween
- global gMemoState -- the play/paused state of the video memo - 0 is play, 1 is paused
- global gSearchFlag
-
-
- set gSearchFlag = 0
- set gMemoState = 0
- -- Mode state: 0 is search, 1 is browse, 2 is map
- set gKnobState = 1
- preloadCast "buttonSound"
- end initGlobals
- --
-
- on setUpKnob
- global gKnobSprite, gKnobLow
- preloadCast "knobSound"
- set gKnobLow = the number of cast "knob00"
- -- channel must contain a sprite when puppet sprite is invoked, so
- -- this is moved to knobSwitch
- --puppetSprite gKnobSprite, true
- end setUpKnob
- --
-
- on quickSwitch theSound
-
- -- assign the sprite channel where the mouse click occured
- set channel = the clickOn
-
- -- make the sprite a puppet, contolled by this lingo
- puppetsprite channel, true
-
- -- check to see if passed argument
- if theSound <> "none" then
- -- make the sound channel a puppet, overriding any sound in the
- -- sound channel of the score and play the arg castmember sound
- puppetSound theSound
- end if
-
- -- set the puppet to a cast member with the name of the puppet concat 'B'
- set theCast = the name of cast( the castNum of sprite channel )
- set the castNum of sprite channel to (the number of cast(theCast & "B"))
- updateStage
-
- --see global navswitch comment
- -- loop during the time sound plays in channel 1
- -- repeat while soundBusy(1)
- -- end repeat
- -- stop sound from playing
- -- puppetSound (0)
-
- -- ignore multiple mouse downs
- repeat while the stilldown
- end repeat
-
- -- reset the puppet to its original cast number
- set the castNum of sprite channel to ( the number of cast theCast )
- updateStage
-
- -- make the sprite a nonpuppet, contolled by the score
- puppetsprite channel, false
-
- end quickSwitch
-
- ------------------------------------------------------------------------
-
- on knobSwitch destMode
-
- global DEBUG
-
- global gKnobSprite, gKnobState, gknobLow
-
- -- sound stop 1
- -- puppetsound 0
-
- preloadMember (member 72 of castLib "shared", member 84 of castLib "shared")
-
- --set upNumber = the mouseH
-
- --set downNumber = the mouseH
-
- -- flush mousedowns
- repeat while the stilldown
- nothing
- end repeat
-
- if destMode = "none" then
- set destMode = 1
- end if
-
- puppetSprite gKnobSprite, true
- if DEBUG then put "gKnobState:" gKnobState
-
- -- Search mode, must go to "greater" mode
- if gKnobState = 0 then
- --if downNumber >= upNumber then
- set destNum = destMode * 4
- puppetSound "knobSound"
- updateStage
- repeat with i = 0 to destnum
- set the castNum of sprite gKnobSprite = (gKnobLow + i)
- if DEBUG then put "gKnobLow+i:" (gKnobLow + i)
- updateStage
- clockWait .1
- end repeat
-
- repeat while soundBusy(1)
- end repeat
-
- set gKnobState = destMode
- exit
- --end if
- end if
-
- -- Browse mode
- if gKnobState = 1 then
- -- going to "lesser" search mode
- if destMode = 0 then
- --if downNumber <= upNumber then
- puppetSound "knobSound"
- updateStage
- repeat with i = 1 to 5
- set the castNum of sprite gKnobSprite = ((gKnobLow + 5) - i)
- if DEBUG then put "gKnobLow+5-i:" (gKnobLow + 5 - i)
- updateStage
- clockWait .1
- end repeat
- set gKnobState = 0
- exit
- --end if
- end if
- -- going to "greater" map mode
- if destMode = 2 then
- --if downNumber <= upNumber then
- set destNum = destMode * 4
- puppetSound "knobSound"
- updateStage
- repeat with i = 4 to destNum
- set the castNum of sprite gKnobSprite = (gKnobLow + i)
- if DEBUG then put "gKnobLow+i:" (gKnobLow + i)
- updateStage
- clockWait .1
- end repeat
- set gKnobState = 2
- exit
- --end if
- end if
- end if
-
- -- Map mode, must go to "lesser" mode
- if gKnobState = 2 then
-
- if destMode = 0 then
-
- puppetSound "knobSound"
- updateStage
- repeat with i = 1 to 9
- set the castNum of sprite gKnobSprite = ((gKnobLow + 9) - i)
- if DEBUG then put "gKnobLow+5-i:" (gKnobLow + 5 - i)
- updateStage
- clockWait .1
- end repeat
- set gKnobState = 0
- exit
-
- end if
-
- if destMode = 1 then
- set destNum = destMode * 4
- puppetSound "knobSound"
- updateStage
- repeat with i = 1 to destnum + 1
- set the castNum of sprite gKnobSprite = ((gKnobLow + 9) - i)
- if DEBUG then put "gKnobLow+9-i:" (gKnobLow + 9 - i)
- updateStage
- clockWait .1
- end repeat
- set gKnobState = 1
- exit
- end if
- end if
-
- end knobSwitch
-
- ------------------------------------------------------------------------
-